<template>
  <div class="left-nav">
    <div class="line"></div>
    <el-menu  class="el-menu-demo" mode="horizontal" @select="handleSelect" background-color="#3399ff"
      text-color="#fff" active-text-color="#ffd04b" :router=true v-if="flagShow">
      <el-menu-item v-for="(item,i) in navList" :key="i" :index="item.name">
        {{ item.navItem }}
    </el-menu-item>
      </el-menu>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
    name:'leftNav',
    data(){
        return{
            navList:[
            {name:'/page/Menu',navItem:'菜单管理'},
            {name:'/page/Role',navItem:'角色管理'},
            {name:'/page/User',navItem:'用户管理'}
        ]
        }
    },
     methods: {
      handleSelect(key, keyPath) {
        console.log(key, keyPath);
      }
    },
    computed: {
      ...mapGetters(['flagShow'])
  }
}
</script>

<style scoped>
</style>
